<template>
	<view>
		<!-- 顶部 -->
		<view class="titleBox">
			<view class="titleLeft">
				<img src="../../static/title/back.png" class="titleBack" @click="goBack">
			</view>
			<view class="titleText">
				<text>求租详情</text>
			</view>
			<view class="titleRight">
		
			</view>
		</view>
		<!-- 内容 -->
		<view class="content">
			<!-- 第一个 -->
			<view class="intention">
				<view class="left">
					<view class="title">
						{{detailList.BusinessPurpose}}
					</view>
					<view class="cont">
						意向租金：<text class="cont-text">{{detailList.Price_min}}-{{detailList.Price_max}}元</text>
					</view>
					<view class="cont">
						意向面积: <text class="cont-text">{{detailList.Aera_min}}-{{detailList.Aera_max}}m²</text>
					</view>
					<view class="cont">
						意向区域: <text class="cont-text">{{detailList.DistinctName}}</text>
					</view>
					<view class="cont" v-if="detailList.RequestType == 1">
						意向类型：<text class="cont-text">租铺</text>
					</view>
					<view class="cont" v-else="detailList.RequestType == 2">
						意向类型：<text class="cont-text">办公房</text>
					</view>
					<view class="cont">
						需求描述：<text class="cont-text"></text>
					</view>
				</view>
			</view>
		</view>
		<!-- 联系租客 -->
		<view class="bom-box">
			<view class="left">
				
			</view>
			<view class="right" @click="isShow = !isShow">
				<uni-icons color="#FF5F17" type="chatbubble" size="24"></uni-icons>
				<text>联系租客</text>
			</view>
		</view>
		<!-- 弹窗 -->
		<view v-if="isShow" class="isShow">
					<view class="isShow-box">
						<view class="top">
							{{detailList.MobilPhone}}
						</view>
						<view class="bottom">
							<uni-icons type="phone-filled"></uni-icons>
							<text>拨打电话</text>
						</view>
					</view>
			</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				isShow:false,
				detailList:[],
			};
		},
		methods: {
			// 返回
			goBack() {
				uni.navigateBack(1)
			},
			// 打开弹窗
			open(){
			        // 通过组件定义的ref调用uni-popup方法 ,如果传入参数 ，type 属性将失效 ，仅支持 ['top','left','bottom','right','center']
			    this.$refs.popup.open('bottom')
			}
		},
		onLoad(option) {
			this.id = option.id
			console.log(option.id)
			this.$myRequest({
				url: 'getRequestDetail',
				data: {
						RequestID: option.id,
					},
					dataType: 'json',
			}).then(res => {
				this.detailList = res.data;
				// console.log(this.detailList)
			})
		},
	}
</script>

<style lang="scss">
.titleBack {
		position: absolute;
		top: 80rpx;
		font-size: 60rpx;
		color: #999999;
	}
	.content {
		padding: 20rpx;
		background-color: #FFFFFF;
		box-shadow: 0rpx 3rpx 8rpx 1rpx rgba(238,238,238,0.16);
		border-radius: 10px;
	}
	.intention {
		display: flex;
		justify-content: space-between;
		padding: 20rpx;
		margin-top: 20rpx;
		background-color: #FFFFFF;
		box-shadow: 0rpx 3rpx 8rpx 1rpx rgba(238,238,238,0.16);
		border-radius: 10px;
		color: #999999;
		.left {
			.title {
				font-size: 32rpx;
				color: #000000;
				margin-top: 10rpx;
			}
		}
	}
	.bom-box {
		position: fixed;
		bottom: 20rpx;
		right: 0;
		display: flex;
		justify-content: space-between;
		width: 100%;
		padding: 32rpx;
		box-sizing: border-box;
		.right {
			display: flex;
			height: 60rpx;
			color: #FF5F17;
			width: 25%;
			border: 1rpx solid #FF5F17;
			border-radius: 20rpx 20rpx 20rpx 20rpx;
			line-height: 60rpx;
			text-align: center;
		}
	}
	.isShow {
		position: fixed;
		bottom: 100rpx;
		width: 100%;
		padding: 20rpx;
		box-sizing: border-box;
		font-family: PingFang SC-Medium, PingFang SC;
		.isShow-box {
			padding: 20rpx;
			border: 1rpx solid #999999;
			   .top {
				   width: 100%;
				   line-height: 100rpx;
				   border: 1rpx solid #999999;
				   text-align: center;
				   margin-bottom: 30rpx;
			   }
			   .bottom {
			   				   width: 100%;
			   				   line-height: 100rpx;
			   				   border: 1rpx solid #999999;
			   				   text-align: center;
			   }
			}
	}
	.cont{
		font-size: 28rpx;
		margin-top: 10rpx;
	}
	.cont-text{
		color: #1B1C1E;
		margin-left: 10rpx;
		font-family: PingFang SC-Medium, PingFang SC;
	}
</style>
